package com.ss.android.article.common.share.helper;

import android.content.Context;

import com.ss.android.article.common.share.abs.AbsShareHelper;
import com.ss.android.article.common.share.entry.ArticleDetailShareBean;
import com.ss.android.article.common.share.interf.IShareArticleBean;
import com.ss.android.article.common.share.interf.IShareDataBean;
import com.ss.android.article.common.share.interf.IShareEssayBean;
import com.ss.android.article.common.share.interf.n;
import com.ss.android.article.share.d.e;
import com.ss.android.article.share.entity.ShareAction;

import inline.ShareDemo;

public final class CommonHtmlShareHelper extends AbsShareHelper {
    private Context mAbsActivity;

    public CommonHtmlShareHelper(Context arg1) {
        this.mAbsActivity = arg1;
    }

    public final boolean a(IShareDataBean arg8, Object[] arg9) {
        boolean v0_1;
        if (this.mAbsActivity == null || arg8 == null) {
            v0_1 = false;
        } else {
            if ((arg8 instanceof IShareArticleBean)) {
                IShareDataBean v5 = arg8;
                if (this.mAbsActivity != null && v5 != null) {
                    if (arg9 != null && arg9.length > 0 && ((arg9[0] instanceof ArticleDetailShareBean))) {
                        Object v0 = arg9[0];
                        if (v0 != null) {
                            v0_1 = ShareDemo.a(this.mAbsActivity, ((ArticleDetailShareBean) v0).itemId, ((ArticleDetailShareBean) v0).content, ((IShareArticleBean) v5), ((ArticleDetailShareBean) v0).isViewValid);
                            return v0_1;
                        } else {
                            return false;
                        }
                    }
                    return false;
                }
                v0_1 = false;
            } else {
                if ((arg8 instanceof IShareEssayBean)) {
                    if (arg8 == null) {
                        return false;
                    }

                    String v2 = this.mAbsActivity.getString(com.ss.android.article.browser.R.string.clip_title);
                    String v3 = ((IShareEssayBean) arg8).f();
                    String v0_2 = "";
                    if (((IShareEssayBean) arg8).b() != null) {
                        v0_2 = this.mAbsActivity.getString(com.ss.android.article.browser.R.string.ve);
                    }

                    return new e(this.mAbsActivity).a(ShareAction.copy_link).b(String.format(this.mAbsActivity.getString(com.ss.android.article.browser.R.string.quickaction_copy_pattern), ((IShareEssayBean) arg8).d(), v0_2, v3)).a(v2).a();
                }

                if (!(arg8 instanceof n)) {
                    return false;
                }

                if (arg8 == null) {
                    return false;
                }

                v0_1 = new e(this.mAbsActivity).a(ShareAction.copy_link).b(((n) arg8).getShareUrl()).a(((n) arg8).getTitle()).a();
            }

            return v0_1;
        }

        return v0_1;
    }

    public final boolean doAction(Object arg2, Object[] arg3) {
        return this.a(((IShareDataBean) arg2), arg3);
    }
}

